import config from '@/utils/config';
import { MockMethod } from 'vite-plugin-mock';

// 获取用户信息
const getUserInfo = {
  url: config.url.user,
  method: 'get',
  response: () => {
    return {
      code: 200,
      data: {
        id: 1,
        username: '13766668888',
        nickname: 'aster',
        avatar:
          'https://img2.baidu.com/it/u=1434094524,2760823040&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
        email: 'aster1004@163.com',
        gender: 'M',
        birthday: '1992-10-04',
        area: '',
        signature: '快乐的搬运工',
      },
      message: 'success',
    };
  },
};

// 获取敏感数据
const getSensitiveData = {
  url: config.url.sensitive,
  method: 'get',
  response: () => {
    return {
      code: 200,
      data: {
        id: 1,
        username: '137****8888',
        realname: '暗影',
        idcard: '37**************54',
        wx_account: 'aster1004',
        qq_account: '',
        zfb_account: '',
        wb_account: '',
      },
      message: 'success',
    };
  },
};

// 修改昵称
const editNickname = {
  url: config.url.nickname,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 修改签名
const editSignature = {
  url: config.url.signatur,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 修改性别
const editGender = {
  url: config.url.gender,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 修改生日
const editBirthday = {
  url: config.url.birthday,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 修改地区
const editArea = {
  url: config.url.area,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 修改头像
const editAvatar = {
  url: config.url.avatar,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 实名认证
const realnameAuthentication = {
  url: config.url.realnameAuthentication,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

export default [
  getUserInfo,
  getSensitiveData,
  editNickname,
  editSignature,
  editGender,
  editBirthday,
  editArea,
  editAvatar,
  realnameAuthentication,
] as MockMethod[];
